﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x02000431 RID: 1073
	[DisallowMultipleComponent]
	public class ObservableEndDragTrigger : ObservableTriggerBase, IEventSystemHandler, IEndDragHandler
	{
		// Token: 0x06001669 RID: 5737 RVA: 0x00061872 File Offset: 0x0005FC72
		void IEndDragHandler.OnEndDrag(PointerEventData eventData)
		{
			if (this.onEndDrag != null)
			{
				this.onEndDrag.OnNext(eventData);
			}
		}

		// Token: 0x0600166A RID: 5738 RVA: 0x0006188C File Offset: 0x0005FC8C
		public IObservable<PointerEventData> OnEndDragAsObservable()
		{
			Subject<PointerEventData> result;
			if ((result = this.onEndDrag) == null)
			{
				result = (this.onEndDrag = new Subject<PointerEventData>());
			}
			return result;
		}

		// Token: 0x0600166B RID: 5739 RVA: 0x000618B4 File Offset: 0x0005FCB4
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onEndDrag != null)
			{
				this.onEndDrag.OnCompleted();
			}
		}

		// Token: 0x04000C9B RID: 3227
		private Subject<PointerEventData> onEndDrag;
	}
}
